package com.argticling.service;

import java.util.List;

import com.argticling.dao.interf.ReaderDAO;
import com.argticling.model.Reader;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * Created by IntelliJ IDEA.
 * User: santor
 * Date: 08-nov-2010
 * Time: 19:43:11
 * To change this template use File | Settings | File Templates.
 */
public class ReaderService {
    @Autowired    
    private ReaderDAO readerDao;

    public void deleteReaderFromWriter(String writerMail, String readerMail){
        readerDao.deleteReader(writerMail, readerMail);
    }

    public Reader getReaderFromWriter(String readerMail, String writerMail){
        return readerDao.getReader(readerMail, writerMail);
    }

    public void persist(Reader reader){
        readerDao.persist(reader);
    }

    public void addReader(String writerEmail, String readerEmail){
        readerDao.newReader(writerEmail, readerEmail);
    }
    
    public void readerList (String username){
    	readerDao.getReaderList(username);
    }
    public List<Reader> getReadersList (String username){
    	return readerDao.getReaderList(username);
    }
}
